package com.chinamsp.exception;

/**
 * chinamsp 基本异常类
 * @author shifenghu
 *
 */
public class BaseException extends RuntimeException {
	
	private static final long serialVersionUID = -1960260400185387581L;
	
	/**
	 * 异常 编码
	 */
	private BaseExceptionType type;
	
	/**
	 * 构造一个带有type 和 message 的异常实例
	 * @param type
	 * @param message
	 */
	public BaseException(BaseExceptionType type, String message) {
		super(message);
		this.type = type;
	}

	/**
	 * 构造一个 带有 type、message 和 异常原因的异常实例
	 * @param type
	 * @param message
	 * @param cause
	 */
	public BaseException(BaseExceptionType type, String message, Throwable cause) {
		super(message, cause);
		this.type = type;
	}
	
	/**
	 * 构造一个 带有 type 和 异常原因的异常实例
	 * @param type
	 * @param cause
	 */
	public BaseException(BaseExceptionType type, Throwable cause) {
		super(cause);
		this.type = type;
	}
	
	public BaseExceptionType getType() {
		return type;
	}

	public void setType(BaseExceptionType type) {
		this.type = type;
	}
	
	
}
